import React from 'react'
import { useParams, useNavigate } from 'react-router-dom'
import ProductDetail from '@/components/ProductDetail'
import { useDetail } from '@/hooks'
export default function Detail() {
  const { id } = useParams()
  const nav = useNavigate()
  const detail = useDetail('/detail/' + id)
  return (
    <div>
      <a href="#" onClick={() => nav(-1)}>Back</a>
      <h1>商品详情</h1>
      <ProductDetail data={ detail } />
      
    </div>
  )
}
